﻿@model Models.Models.InvoiceList
@using WebApp.Classes

@{
    ViewBag.Title = "Invoices";
    var rights = ViewBag.rights;
}

@Scripts.Render("~/scripts/jquery.fixheadertable.js")

<table width="100%">
    <tbody>
        <tr>
            <td width="100%" valign="top">
                         
                    <div style="border-style: solid; border-width: 1px; border-color: #DDDDDD"> 
                    <table class="table table-striped">
                        <thead>
                        <tr>
                            <th>
                                Store
                            </th>
                            <th>
                                Domain
                            </th>
                            <th>
                                Date
                            </th>
                            <th>
                                PopUp
                            </th>
                            <th>
                                Submitted
                            </th>
                            <th>
                                PopUp Total
                            </th>
                            <th>
                                Submitted Total
                            </th>
                            <th>
                                Period
                            </th>
                            <th>
                                Type
                            </th>
                            <th>
                                Unit
                            </th>
                            <th>
                                Rate
                            </th>
                        </tr>
                        </thead>
                        <tbody>
                        @{
                            foreach (var invoice in Model.List)
                            {
                                <tr>
                                    <td>
                                        @invoice.StoreName
                                    </td>
                                    <td>
                                        @invoice.DomainName
                                    </td>
                                    <td>
                                        @invoice.SessionDate.ToString("MM/dd/yyyy hh:mm tt")
                                    </td>
                                    <td>
                                        @(invoice.PopUpFlag ? Html.Raw("<i class=\"icon-check\"></i>") : Html.Raw(""))
                                    </td>
                                    <td>
                                        @(invoice.OrderSubmitFlag ? Html.Raw("<i class=\"icon-check\"></i>") : Html.Raw(""))
                                    </td>
                                    <td>
                                        @invoice.PopUpOrderTotal.ToString("###,###,###.00")
                                    </td>
                                    <td>
                                        @invoice.SubmitOrderTotal.ToString("###,###,###.00")
                                    </td>
                                    <td>
                                        @invoice.BillingPeriodName
                                    </td>
                                    <td>
                                        @invoice.BillingTypeName
                                    </td>
                                    <td>
                                        @invoice.BillingUnit
                                    </td>
                                    <td>
                                        @invoice.BillingRate
                                    </td>
                                </tr>
                            }
                        }
                            <tr>
                                <td colspan="9">
                                </td>
                                <td colspan="2" style="text-align: right">
                                    <form ></form>
                                    <h5>Records: @Model.ResultCount</h5>
                                </td>
                            </tr>
                        </tbody>                          
                    </table>
                    </div>
            </td>
        </tr>
    </tbody>
</table>      
